package com.zhangxin.designmode.oop.demo3.abstractdemo;

import java.io.IOException;
import java.util.logging.Level;

/**
 * @author zhangxin
 * @date 2022/4/6
 */
public class MessageQueueLogger extends AbstractLogger {

    private MessageQueueClient messageQueueClient;

    public MessageQueueLogger(String name, boolean enabled, Level minPermittedLevel, MessageQueueClient messageQueueClient) throws IOException {
        super(name, enabled, minPermittedLevel);
        this.messageQueueClient = messageQueueClient;
    }

    @Override
    protected void doLog(Level level, String message) throws IOException {
        //格式化level 和 message
        String formatStr = "";
        messageQueueClient.send(formatStr);
    }
}
